﻿using UnityEditor;
using UnityEngine;

namespace XUBugly
{
    namespace Editor
    {
        internal class XUBuglyConfigWindow : EditorWindow
        {
            [MenuItem("XUPK/XUBugly/Configure", false, 1)]
            public static void SetConfig()
            {
                EditorWindow window = GetWindow<XUBuglyConfigWindow>("Bugly");
                window.minSize = window.maxSize = new Vector2(800, 400);
                window.Show();
            }

            private XUBuglyConfig buglyConfig = null;

            private void OnGUI()
            {
                if (buglyConfig == null)
                {
                    buglyConfig = XUBuglyConfig.LoadOrCreate();
                }
                buglyConfig.OnGUI();
                buglyConfig.Save();
            }
        }
    }
}
